package com.dpstudio.plugin.cms.xml;

import java.util.HashMap;

public class CmsTagConstant {

    public static final String VAR = "var";
    public static final String ID = "id";
    public static final String TYPE = "type";
    public static final String PAGE = "page";
    public static final String PAGE_SIZE = "pageSize";
    public static final String NAME = "name";
    public static final String BASE_NAME = "baseName";
    public static final String PARENT_ID = "parentId";
    public static final String HIDDEN = "hidden";
    public static final String CLIENT = "client";
    public static final String CATEGORY_NAME = "categoryName";
    public static final String SITE_KEY = "siteKey";
    public static final String ORDER_BY = "orderBy";
    public static final String CATEGORY_ID = "categoryId";
    public static final String KEY = "key";
    public static final String DATE = "date";
    public static final String PATTERN = "pattern";
    public static final String RESOURCE_ID = "resourceId";
    public static final String TOTAL_PAGES = "totalPages";
    public static final String CURRENT_PAGES = "currentPage";
    public static final String PAGE_URL = "pageUrl";
    public static final String GROUP_ID = "groupId";
    public static final String INNER_LOOP = "innerLoop";

    public static final String DEFAULT_SITE_KEY = "${siteKey}";

    public static final String CMS_CATEGORY = "cms.category";
    public static final String CMS_ARCHIVE = "cms.archive";
    public static final String CMS_SITE = "cms.site";
    public static final String CMS_COMPANY = "cms.company";
    public static final String CMS_CONFIG = "cms.config";
    public static final String CMS_DATE = "cms.date";
    public static final String CMS_ATTACH = "cms.attach";
    public static final String CMS_LINK = "cms.link";
    public static final String CMS_PAGE = "cms.page";
    public static final String CMS_CAROUSEL = "cms.carousel";
    public static final String CMS_CAROUSEL_CATEGORY = "cms.carousel_category";
    public static final String CMS_MESSAGE_CATEGORY = "cms.message_category";
    public static final String CMS_MESSAGE_JS = "cms.message_js";
    public static final String CMS_SEO = "cms.seo";

    public static HashMap<String, HashMap<String, String[]>> TAG_CONSTANT = new HashMap<>();

    static {

        //分类
        HashMap<String, String[]> categoryMap = new HashMap<>();
        categoryMap.put(VAR, new String[]{});
        categoryMap.put(SITE_KEY, new String[]{DEFAULT_SITE_KEY});
        categoryMap.put(ORDER_BY, new String[]{});
        categoryMap.put(ID, new String[]{});
        categoryMap.put(TYPE, new String[]{});
        categoryMap.put(PAGE, new String[]{});
        categoryMap.put(PAGE_SIZE, new String[]{});
        categoryMap.put(NAME, new String[]{});
        categoryMap.put(BASE_NAME, new String[]{});
        categoryMap.put(PARENT_ID, new String[]{});
        categoryMap.put(HIDDEN, new String[]{"0", "1"});
        categoryMap.put(CLIENT, new String[]{"0", "1"});
        categoryMap.put(CATEGORY_NAME, new String[]{});
        TAG_CONSTANT.put(CMS_CATEGORY, categoryMap);

        //文章
        HashMap<String, String[]> archiveMap = new HashMap<>();
        archiveMap.put(VAR, new String[]{});
        archiveMap.put(SITE_KEY, new String[]{DEFAULT_SITE_KEY});
        archiveMap.put(ORDER_BY, new String[]{});
        archiveMap.put(CATEGORY_ID, new String[]{});
        archiveMap.put(CLIENT, new String[]{"0", "1"});
        archiveMap.put(PAGE, new String[]{});
        archiveMap.put(PAGE_SIZE, new String[]{});
        archiveMap.put(CATEGORY_NAME, new String[]{});
        TAG_CONSTANT.put(CMS_ARCHIVE, archiveMap);


        //站点
        HashMap<String, String[]> siteMap = new HashMap<>();
        siteMap.put(VAR, new String[]{});
        siteMap.put(SITE_KEY, new String[]{DEFAULT_SITE_KEY});
        TAG_CONSTANT.put(CMS_SITE, siteMap);

        //公司
        HashMap<String, String[]> companyMap = new HashMap<>();
        companyMap.put(VAR, new String[]{});
        companyMap.put(SITE_KEY, new String[]{DEFAULT_SITE_KEY});
        TAG_CONSTANT.put(CMS_COMPANY, companyMap);

        //系统设置
        HashMap<String, String[]> configMap = new HashMap<>();
        configMap.put(VAR, new String[]{});
        configMap.put(SITE_KEY, new String[]{DEFAULT_SITE_KEY});
        configMap.put(PAGE, new String[]{});
        configMap.put(PAGE_SIZE, new String[]{});
        configMap.put(KEY, new String[]{});
        TAG_CONSTANT.put(CMS_CONFIG, configMap);


        //时间转换
        HashMap<String, String[]> dateTimeMap = new HashMap<>();
        dateTimeMap.put(VAR, new String[]{});
        dateTimeMap.put(DATE, new String[]{});
        dateTimeMap.put(PATTERN, new String[]{"yyyy-MM-dd HH:mm:ss"});
        TAG_CONSTANT.put(CMS_DATE, dateTimeMap);

        //附件
        HashMap<String, String[]> attachMap = new HashMap<>();
        attachMap.put(VAR, new String[]{});
        attachMap.put(SITE_KEY, new String[]{DEFAULT_SITE_KEY});
        attachMap.put(TYPE, new String[]{});
        attachMap.put(PAGE, new String[]{});
        attachMap.put(PAGE_SIZE, new String[]{});
        attachMap.put(RESOURCE_ID, new String[]{});
        TAG_CONSTANT.put(CMS_ATTACH, attachMap);


        //友情链接
        HashMap<String, String[]> linkMap = new HashMap<>();
        linkMap.put(VAR, new String[]{});
        linkMap.put(SITE_KEY, new String[]{DEFAULT_SITE_KEY});
        linkMap.put(PAGE, new String[]{});
        linkMap.put(PAGE_SIZE, new String[]{});
        TAG_CONSTANT.put(CMS_LINK, linkMap);


        //分页
        HashMap<String, String[]> pageMap = new HashMap<>();
        pageMap.put(VAR, new String[]{});
        pageMap.put(SITE_KEY, new String[]{DEFAULT_SITE_KEY});
        pageMap.put(TOTAL_PAGES, new String[]{});
        pageMap.put(CURRENT_PAGES, new String[]{});
        pageMap.put(PAGE_URL, new String[]{});
        TAG_CONSTANT.put(CMS_PAGE, pageMap);


        //轮播图
        HashMap<String, String[]> carouselMap = new HashMap<>();
        carouselMap.put(VAR, new String[]{});
        carouselMap.put(SITE_KEY, new String[]{DEFAULT_SITE_KEY});
        carouselMap.put(GROUP_ID, new String[]{});
        carouselMap.put(INNER_LOOP, new String[]{"1", "0"});
        TAG_CONSTANT.put(CMS_CAROUSEL, carouselMap);

        //轮播图组
        HashMap<String, String[]> carouselCategoryMap = new HashMap<>();
        carouselCategoryMap.put(VAR, new String[]{});
        carouselCategoryMap.put(SITE_KEY, new String[]{DEFAULT_SITE_KEY});
        carouselCategoryMap.put(CATEGORY_ID, new String[]{});
        TAG_CONSTANT.put(CMS_CAROUSEL_CATEGORY, carouselCategoryMap);


        //留言分组
        HashMap<String, String[]> messageCategoryMap = new HashMap<>();
        carouselCategoryMap.put(VAR, new String[]{});
        carouselCategoryMap.put(SITE_KEY, new String[]{DEFAULT_SITE_KEY});
        messageCategoryMap.put(NAME, new String[]{});
        messageCategoryMap.put(PARENT_ID, new String[]{});
        TAG_CONSTANT.put(CMS_MESSAGE_CATEGORY, messageCategoryMap);


        //留言
        HashMap<String, String[]> messageJslMap = new HashMap<>();
        messageJslMap.put(VAR, new String[]{});
        messageJslMap.put(SITE_KEY, new String[]{DEFAULT_SITE_KEY});
        TAG_CONSTANT.put(CMS_MESSAGE_JS, messageJslMap);

        //seo信息
        HashMap<String, String[]> seoMap = new HashMap<>();
        seoMap.put(VAR, new String[]{});
        seoMap.put(SITE_KEY, new String[]{DEFAULT_SITE_KEY});
        seoMap.put(CATEGORY_NAME, new String[]{});
        TAG_CONSTANT.put(CMS_SEO, seoMap);


    }
}
